﻿using Core.Model;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace Core.DataAccess.Tools.Implementations.OverrideMappings
{
    public class QuestionListMapping : IAutoMappingOverride<Core.Model.QuestionList>
    {
        #region Implementation of IAutoMappingOverride<QuestionList>

        public void Override(AutoMapping<QuestionList> mapping)
        {
            mapping.HasMany(x => x.Questions).KeyColumn("QuestionListId").Cascade.All();
            mapping.References(x => x.User, "UserId").Cascade.None();
        }

        #endregion
    }
}
